package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingClassMapper;
import com.ruoyi.teaching.domain.TeachingClass;
import com.ruoyi.teaching.service.ITeachingClassService;

/**
 * 班级信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingClassServiceImpl implements ITeachingClassService 
{
    @Autowired
    private TeachingClassMapper teachingClassMapper;

    /**
     * 查询班级信息
     * 
     * @param classId 班级信息主键
     * @return 班级信息
     */
    @Override
    public TeachingClass selectTeachingClassByClassId(Long classId)
    {
        return teachingClassMapper.selectTeachingClassByClassId(classId);
    }

    /**
     * 查询班级信息列表
     * 
     * @param teachingClass 班级信息
     * @return 班级信息
     */
    @Override
    public List<TeachingClass> selectTeachingClassList(TeachingClass teachingClass)
    {
        return teachingClassMapper.selectTeachingClassList(teachingClass);
    }

    /**
     * 新增班级信息
     * 
     * @param teachingClass 班级信息
     * @return 结果
     */
    @Override
    public int insertTeachingClass(TeachingClass teachingClass)
    {
        teachingClass.setCreateTime(DateUtils.getNowDate());
        return teachingClassMapper.insertTeachingClass(teachingClass);
    }

    /**
     * 修改班级信息
     * 
     * @param teachingClass 班级信息
     * @return 结果
     */
    @Override
    public int updateTeachingClass(TeachingClass teachingClass)
    {
        teachingClass.setUpdateTime(DateUtils.getNowDate());
        return teachingClassMapper.updateTeachingClass(teachingClass);
    }

    /**
     * 批量删除班级信息
     * 
     * @param classIds 需要删除的班级信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassByClassIds(Long[] classIds)
    {
        return teachingClassMapper.deleteTeachingClassByClassIds(classIds);
    }

    /**
     * 删除班级信息信息
     * 
     * @param classId 班级信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassByClassId(Long classId)
    {
        return teachingClassMapper.deleteTeachingClassByClassId(classId);
    }
}
